<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>搜索-最美乡村</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wx/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wx/css/country.css" />
</head>
<body>
<div class="country">
  <div id="header">
    <div class="logo"></div>
    <div class="search">
      <form action="_MODULE__/Village/country_ls/" method="get" enctype="multipart/form-data">
        <input name="keyword" type="text" placeholder="搜索乡村" value="{$keyword}"/>
      </form>
      <i></i></div>
  </div>
  <div class="countrylist" style="margin-top:4px;">
    <div class="list">
      <ul id="list">
        <volist name="all" id="vo">
          <li> <a href="__MODULE__/Village/info/id/{$vo.id}/">
            <div class="pic">
              <eq name="vo.f_img" value=""> <img src="__PUBLIC__/wx/images/pic01.jpg"/>
                <else/>
                <img src="__PUBLIC__/Uploads/{$vo.f_img}"/> </eq>
            </div>
            <div class="intro">
              <h2>{$vo.title}</h2>
              <!--<div class="review"><span class="star"></span><span class="star"></span><span class="star"></span><span class="star"></span><span></span><b>距我：<c id="long_{$vo.id}">3.1km</c></b></div>-->
              <div class="paragraph">
                <p>{$vo.content|preg_replace='/<[^>]*>/','',###|mb_substr=0,90,'utf-8'}</p>
              </div>
              <div class="people"><span>乡土卫士</span><div class="right"><b> 
              <eq name="vo.u_img" value=""><img src="__PUBLIC__/wx/images/pic18.jpg"/><else/><img src="__PUBLIC__/Uploads/{$vo.u_img}"/></eq>
              </b><em>{$vo.u_name}</em><i>{$vo.u_supports}</i></div></div>
            </div>
            </a> </li>
        </volist>
      </ul>
    </div>
  </div>
</div>
</body>
<script src="__PUBLIC__/wx/js/jquery-1.9.1.js"></script>
<script type="text/javascript">
//瀑布流
var page=1;
$(function () {
	$(window).scroll(function () {
		if (($(document).height() - $(this).scrollTop() - $(this).height())<1){	
			setTimeout(function(){
				//alert("getMore");
				page++;
				getMore();
			},1000);
		}
	});
})
function getMore(){
    $.ajax({
    type : "GET",
    dataType : "json",
    url: "__MODULE__/Village/country/page/"+page+"/keyword/{$keyword}/",
    async:false,
    success: function(data){
		var html='';
		if(data.length>0){
			for(var i=0;i<data.length;i++){
				html=html+"<li><a href='__MODULE__/Village/info/id/"+data[i].id+"/'><div class='pic'>";
				if(data[i].f_img==''){
					html=html+"<img src='__PUBLIC__/wx/images/pic01.jpg'/>";
					}else{
						html=html+"<img src='__PUBLIC__/Uploads/"+data[i].f_img+"'/>";
					}
				html=html+"</div><div class='intro'><h2>"+data[i].title+"</h2><div class='paragraph'><p>"+data[i].content+"</p></div></div></a></li>";
				}//end for
			$("#list").append(html);//添加新的
			}else{
				$(".loadMore").text("没有了！");
			}
    }
	});//end ajax
}//end fun
</script>
</html>